package com.learn.annotation.services;

import com.learn.annotation.daos.IHelloWordDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("helloWordService")
public class HelloWordServiceImpl implements IHelloWordService {

    @Autowired
    private IHelloWordDao helloWordDao;

    public void save(String name) {
        helloWordDao.save(name);
        System.out.println("service save success");
    }

    @Override
    public String query(String id) {
        String retVal = helloWordDao.query(id);
        System.out.println("service query result: "+retVal);
        throw new RuntimeException("自定义异常");
//        return "service query success";
    }
}
